f9c26c
@@ -495,7 +495,10 @@
protected SymbolFunctionResult match(Object row, PTFPartitionIterator<Object> pI
         rowResult = symbolFn.match(row, pItr);
       }
 
-      result.nextRow = pItr.getIndex() - 1;
+      result.nextRow = pItr.getIndex();
+      if(pItr.hasNext()) {
+        result.nextRow -= 1;
+      }
       return result;
     }
 
